const q=document.querySelector
      $=q.bind(document)

let $height=$("#height")
let $width=$("#width")
let $perimeter=$("#perimeter")
let $area=$("#area")

$form=$("form")

$form.onsubmit=function(e){
    e.preventDefault();
    let perimeter=(parseInt($width.value)+parseInt($height.value))*2
    let area=$width.value*$height.value
    $perimeter.value=perimeter
    $area.value=area
}


// let width=document.getElementById('width')
// let height=document.getElementById('height')
// let perimeter=document.getElementById('perimeter')
// let calculate=document.getElementById('calculate')
// let area=document.getElementById('area')
// let form=document.getElementsByTagName("form")[0]

// calculate.onclick=function(){
//     console.log(width.value)
//     console.log(height.value)
//     let perimeter1=(parseInt(width.value)+parseInt(height.value))*2
//     let area1=width.value*height.value
//     perimeter.value=perimeter1
//     area.value=area1
// }


    